<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
const arr = [
    { uname: '孙六', age: 39 },
    { uname: '刘七', age: 21 },
    { uname: '刘七', age: 1 },
    { uname: '张三', age: 59 },
    { uname: '李四', age: 29 },
    { uname: '王二', age: 19 },
]
// 前提克隆一份数据 
// 1，把age中个位数为9的替换成*  { uname: '孙六', age: 2* },
// 2，把张三的这个对象干掉，添加个{uname:'老六',age: 12}
// 3, 根据年龄排序 过滤到小于18岁的
for (let i = 0; i <arr.length; i++) {
  if((arr[i].age+1) %10 ==0) {
    arr[i].age = parseInt((arr[i].age)/10)+`*`
  }

  if(arr[i].uname == '张三') {
    arr.splice(arr[i], 1 ,{uname:'老六',age: 12})
  }
}
console.log(arr);

  </script>
</body>
</html>